package me.itsoo.artemis.framework.ioc.context;

import me.itsoo.artemis.framework.core.eventbus.EventBus;
import me.itsoo.artemis.framework.core.eventbus.Subscriber;
import me.itsoo.artemis.framework.ioc.context.event.ApplicationEvent;

import java.util.List;

/**
 * ApplicationEventPublisher
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/6/14
 */
public interface ApplicationEventPublisher {

    /**
     * 获取上下文事件总线
     *
     * @return EventBus
     */
    EventBus getApplicationEventBus();

    /**
     * 注册订阅
     *
     * @param subClasses List
     */
    @SuppressWarnings("rawtypes")
    void registerSubscribers(List<Class<? extends Subscriber>> subClasses);

    /**
     * 发布事件
     *
     * @param event ApplicationEvent
     */
    void publishEvent(ApplicationEvent event);

}
